#ifndef __RANDOM_H__
#define __RANDOM_H__

//http://www.bedaux.net/mtrand/mtrand.h.html

// inline for speed, must therefore reside in header file

class RandomNumberGenerator
{
public:
	RandomNumberGenerator() {seed(5489UL); }
	void seed(unsigned long seed);
	unsigned long operator()();
private:
	enum { n = 624, m = 397 };
	unsigned long state[n]; // state vector array
	int p; 
};

extern RandomNumberGenerator RNG;

#endif // __RANDOM_H__
